import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

class Common {
  // button背景颜色
  static int muji = 0xff7f0019;
  static ButtonStyle buttonStyle = TextButton.styleFrom(
    backgroundColor: Color(muji),
    padding: EdgeInsets.all(10),
  );
  // button 文字样式
  static TextStyle buttonTextStyle = TextStyle(
    fontSize: 18.0,
    color: Colors.white,
  );
  // 获取焦点边框样式
  static OutlineInputBorder focusedBorder = OutlineInputBorder(
      borderSide: BorderSide(color: Color(muji), width: 1.0));
  // toast提示
  static showTost(String msg,
      [Color bgColor = Colors.black,
      Color textColor = Colors.white,
      int time = 3]) {
    Fluttertoast.showToast(
        msg: msg, // 提示信息
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.TOP, // 显示位置
        timeInSecForIosWeb: time, // 提示时间
        backgroundColor: bgColor, // 背景颜色
        textColor: textColor, // 文字颜色
        fontSize: 16.0);
  }

  closeTost() {
    Fluttertoast.cancel();
  }
}
